<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basproject/basicdata/Bas_MachineType.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basproject/basicdata/Bas_MachineType.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name:'Bas_MachineType',
        setup() {
            const table = ref({
                key: "MachineTypeId",
                footer: "Foots",
                cnName: "设备类型管理",
                name: "basicdata/Bas_MachineType",
                newTabEdit: false,
                url: "/Bas_MachineType/",
                sortName: "MachineTypeCode,CreateTime"
            });
            const editFormFields = ref({"ParentId":[],"MachineTypeCode":"","MachineTypeName":"","MachineTypeDesc":"","Enabled":"","Remarks":""});
            const editFormOptions = ref([[{"dataKey":"BASE_MachineTypeList","data":[],"title":"父阶类型","field":"ParentId","type":"cascader"}],
                              [{"title":"类型编码","required":true,"field":"MachineTypeCode","type":"text"}],
                              [{"title":"类型名称","required":true,"field":"MachineTypeName","type":"text"}],
                              [{"title":"类型描述","field":"MachineTypeDesc","type":"textarea"}],
                              [{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"switch"}],
                              [{"title":"备注","field":"Remarks","type":"textarea"}]]);
            const searchFormFields = ref({"MachineTypeCode":"","MachineTypeName":"","MachineTypeDesc":"","ParentId":[]});
            const searchFormOptions = ref([[{"title":"类型编码","field":"MachineTypeCode"},{"title":"类型名称","field":"MachineTypeName"},{"title":"类型描述","field":"MachineTypeDesc"},{"dataKey":"BASE_MachineTypeList","data":[],"title":"父阶类型","field":"ParentId","type":"cascader"}]]);
            const columns = ref([{field:"MachineTypeId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineTypeCode",title:"类型编码",type:"string",link:true,width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineTypeName",title:"类型名称",type:"string",width:150,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineTypeDesc",title:"类型描述",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"ParentId",title:"父阶类型",type:"bigint",bind:{ key:"BASE_MachineTypeList",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
